Skip to content

feat: storage radius check - #618

Open
akrem-chabchoub wants to merge 11 commits into
masterfrom
feat/storage-radius-check
Open

feat: storage radius check#618
akrem-chabchoub wants to merge 11 commits into
masterfrom
feat/storage-radius-check

Conversation

@akrem-chabchoub

@akrem-chabchoub akrem-chabchoub commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

feat: add storage-radius check

What this tests

Every Bee node has limited storage (its "reserve"). When the reserve fills up,
Bee is supposed to shrink its storage radius (by making radius++ , meaning it becomes responsible
for a smaller slice of the network's data, so it can evict chunks it no
longer needs to keep. When the node later has room again (e.g. because
someone stretches out their postage batches so their chunks belong elsewhere),
the radius should grow back.

This check proves that behavior actually happens on a running cluster:

  1. Fill up the nodes' reserves with data until the radius increases.
  2. Dilute the postage batches (spread them out so their chunks now belong
    outside the radius).
  3. Confirm the radius comes back down.

If either step doesn't happen, the check fails and tells you why.

How it works, step by step

  1. Wait for warmup — newly-started nodes report a warming up status;
    wait until every node is past that before testing anything.
  2. Get postage batches — each node needs its own postage batch to pay for
    the uploads. Reuse one if a usable batch from a previous run already
    exists (saves time and on-chain fees); otherwise buy a new one.
  3. Upload data until the reserve fills up — upload random chunks across
    all nodes in parallel, in waves, pausing briefly between waves so a
    background watcher can check whether we've uploaded enough yet (this
    avoids uploading way more than needed).
  4. Wait for the radius to rise — poll all nodes until one of them reports
    a radius greater than 0. Remember which node it was.
  5. Let the upload backlog settle — uploads don't take effect on the
    reserve instantly; there's a queue. Wait for that queue to drain (or skip
    this if the reserve is already basically full, since backlogged chunks
    will just get evicted anyway).
  6. Dilute the postage batches — increase each batch's depth, which spreads
    its stake over more of the network and pushes its chunks outside the
    node's storage radius.
  7. Wait for the radius to fall back down — poll the same node from step 4
    until its radius drops below where it was. If it doesn't drop within the
    timeout, fail with the node's current chunk count and sync rate so it's
    easy to tell why.

What's included

  • pkg/check/storageradius/storageradius.go — the check itself, registered
    under the name storage-radius.
  • Small API additions the check needed:
    • IsWarmingUp on node status, so the check can tell warmup apart from a
      genuinely stuck node.
    • A typed response for the /debugstore endpoint (previously untyped),
      used to read how many chunks are still queued for upload.
  • A config entry for running this against the local bee-playground cluster.

How to run it

./dist/beekeeper check \
  --cluster-name=bee-playground \
  --checks=pg-storage-radius \
  --timeout=90m

Requires a Bee image with a small reserve capacity (a few thousand chunks
instead of millions) — otherwise filling the reserve for real would take
far too long to ru.

@akrem-chabchoub akrem-chabchoub changed the title Feat/storage radius check feat: storage radius check Aug 18, 2026
@akrem-chabchoub akrem-chabchoub self-assigned this Aug 18, 2026
@akrem-chabchoub
akrem-chabchoub marked this pull request as ready for review August 20, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant